﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using K9Nano.Domain;

namespace K9Nano.Authorization
{
    /// <summary>
    /// 禁止访问的用户黑名单
    /// </summary>
    [Table("AppUserBlackList")]
    public class UserBlacklist : Entity<Guid>, IMayHaveTenant, ICreationAudited
    {
        [Required]
        [StringLength(100)]
        public string User { get; set; }

        [Required]
        [StringLength(200)]
        public string Reason { get; set; }

        [Required]
        public EUserBlackListPolicy Policy { get; set; }
        public string Clients { get; set; }
        public Guid? TenantId { get; set; }
        public Guid? CreatorUserId { get; set; }
        public DateTimeOffset CreationTime { get; set; }
    }

    public enum EUserBlackListPolicy
    {
        /// <summary>
        /// 完全禁止
        /// </summary>
        Entirely = 0,
        /// <summary>
        /// 部分禁止
        /// </summary>
        Partially = 1
    }
}